import { withRouter } from 'next/router';
import Link from 'next/link';

const Dropdown = ({ }) => {

    const dropMenu = [
        {
            title: '林芝旅游',
            url: '/linzhi',
            list: [
                {name: '雅鲁藏布大峡谷', url: '/ticket/578.html'},
                {name: '巴松措', url: '/ticket/590.html'},
                {name: '苯日', url: '/ticket/592.html'},
                {name: '鲁朗', url: '/'},
            ]
        },
        {
            title: '拉萨旅游',
            url: '/lasa',
            list: [
                {name: '布达拉宫', url: '/ticket/578.html'},
                {name: '大昭寺', url: '/ticket/613.html'},
                {name: '纳木错', url: '/ticket/592.html'},
                {name: '羊湖', url: '/'},
                {name: '日托寺', url: '/ticket/605.html'},
                {name: '卡若拉冰川', url: '/'},
            ]
        },
        {
            title: '阿里旅游',
            url: '/ali',
            list: [
                {name: '冈仁波齐', url: '/ticket/646.html'},
                {name: '玛旁雍错', url: '/ticket/649.html'},
                {name: '色龙寺', url: '/line/627.html'},
                {name: '拉昂错', url: '/ticket/678.html'},
                {name: '古格王朝', url: '/ticket/678.html'},
            ]
        },
        {
            title: '西藏其他地区',
            url: '/destination',
            list: [
                {name: '日喀则', url: '/'},
                {name: '珠穆朗玛国家公园', url: '/'},
                {name: '珠峰大本营', url: '/'},
                {name: '山南', url: '/'},
                {name: '墨脱', url: '/'},
            ]
        }
    ]

    return (
        <div className="dropdown-menu">
            {
                dropMenu.map((item, index) => {
                    const { list } = item;
                    return (
                        <div className="menu" key={index}>
                            <h3>
                                <Link href={item.url} prefetch={false}>
                                    <a target="_blank">{item.title}</a>
                                </Link>
                            </h3>
                            {
                                list.map((item1, index1) => <Link href={item1.url} key={index1} prefetch={false}><a target="_blank">{item1.name}</a></Link>)
                            }
                        </div>
                    )
                })
            }
        </div>
    )
}

export default withRouter(Dropdown)